package Offer.offer;

/**
 * 单例模式
 * 懒汉式  双重检测锁
 * @author leiwenkang
 * @date 2020/4/6
 */
public class Test02b单例模式_懒汉式双重检测锁 {

    private volatile static Test02b单例模式_懒汉式双重检测锁 instance;

    private Test02b单例模式_懒汉式双重检测锁() {

    }

    public static Test02b单例模式_懒汉式双重检测锁 getInstance() {
        if (instance == null) {
            synchronized (Test02b单例模式_懒汉式双重检测锁.class) {
                if (instance == null) {
                    instance = new Test02b单例模式_懒汉式双重检测锁();
                }
            }
        }
        return instance;
    }
}